package com.zy.mc_module.ui.micang;

import android.content.Intent;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.zy.mc_module.base.kotlin.BaseActivity;
import com.zy.mc_module.databinding.ActivityMemberConfigBinding;
import com.zy.mc_module.ui.micang.adapter.MemberConfigAdapter;
import com.zy.mc_module.utils.StatusBarUtil;
import com.zy.mc_module.utils.retrofit.error.ThdException;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * 会员等级
 */
public class MemberConfigActivity extends BaseActivity<RiceContract.View,RicePresenter,ActivityMemberConfigBinding> implements RiceContract.View{

    private MemberConfigAdapter adapter;

    @NonNull
    @Override
    public ActivityMemberConfigBinding getViewBinding() {
        return ActivityMemberConfigBinding.inflate(getLayoutInflater());
    }

    @Override
    protected void initView() {
        super.initView();
        StatusBarUtil.setImmersiveStatusBar(this);
        binding.customhead.setLeftClickListener(view -> finish());
        adapter = new MemberConfigAdapter(new ArrayList<>());
        ActivityMemberConfigBinding binding = getBinding();
        binding.rcvMemberConfig.setLayoutManager(new LinearLayoutManager(context));
        binding.rcvMemberConfig.setAdapter(adapter);
        binding.mineMemberLv.setText(getIntent().getStringExtra("MineLevel"));
        binding.mineMemberCurrentExp.setText("当前经验值:" + getIntent().getStringExtra("MineExp"));
    }

    @Override
    protected void initListener() {
        super.initListener();
        getBinding().customhead.setRightClickListener3(view -> {
            startActivity(new Intent(context,ExpDetailActivity.class));
        });
    }

    @Override
    public void onError(ThdException error) {

    }

    @Override
    public <T> void onSuccess(T t, int type) {

    }

    @Override
    public void onError(ThdException error, int type) {

    }
}
